**************************
*** TAA Responsiveness *** 
**************************

use "kimpelc_czone_t2.dta", clear

*** Table A5 Summary statistics 

eststo clear
estpost summarize l_trans_taaimp_pc l_cz_TAAdlrs_petit_czpc l_cz_TAAdlrs_petit_cert_czpc l_cz_TAAdlrs_wrks_czpc l_cz_TAAdlrs_wrks_cert_czpc 
esttab using "TableA5.tex", cells("count mean(fmt(2)) sd(fmt(2)) min(fmt(2)) max(fmt(2))") nomtitle nonumber label replace b(3)

*** Table A6 Cross-correlation table 

eststo clear
estpost correlate l_trans_taaimp_pc l_cz_TAAdlrs_petit_czpc l_cz_TAAdlrs_petit_cert_czpc l_cz_TAAdlrs_wrks_czpc l_cz_TAAdlrs_wrks_cert_czpc, matrix listwise
esttab using "TableA6.tex", unstack not noobs compress label replace b(2) nostar

drop if year == 2007

*** Table A9 & Panel A 

eststo clear
eststo: ivregress 2sls d_trans_taaimp_pc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls d_cz_TAAdlrs_petit_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls d_cz_TAAdlrs_petit_cert_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls d_cz_TAAdlrs_wrks_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls d_cz_TAAdlrs_wrks_cert_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* [aw=timepwt48], cluster(statefip)

esttab using "TableA9-A.tex", label keep(d_tradeusch_pw) se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars

*** Table A9 & Panel B 

eststo clear
eststo: ivregress 2sls l_trans_taaimp_pc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls l_cz_TAAdlrs_petit_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls l_cz_TAAdlrs_petit_cert_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls l_cz_TAAdlrs_wrks_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls l_cz_TAAdlrs_wrks_cert_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* [aw=timepwt48], cluster(statefip)

esttab using "TableA9-B.tex", label keep(l_tradeusch_pw) se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars

*** Table A10

eststo clear
eststo: ivregress 2sls l_trans_taaimp_pc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.czone t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls l_cz_TAAdlrs_petit_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.czone t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls l_cz_TAAdlrs_petit_cert_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.czone t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls l_cz_TAAdlrs_wrks_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.czone t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls l_cz_TAAdlrs_wrks_cert_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource i.czone t2 [aw=timepwt48], cluster(statefip)

esttab using "TableA10.tex", label keep(l_tradeusch_pw) indicate("Decade FE = t2") se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars

*** Table A11

eststo clear
eststo: ivregress 2sls lnchg_trans_taaimp_pc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls lnchl_cz_TAAdlrs_petit_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls lnchl_cz_TAAdlrs_cert_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls lnchl_cz_TAAdlrs_wrks_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
eststo: ivregress 2sls lnchl_cz_TAAdlrs_wrks_cert_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)

esttab using "TableA11.tex", label keep(d_tradeusch_pw) indicate("Decade FE = t2") se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars

*** Table A12 /* Table reported in the appendix was manually created based on the test results */

* Panel A: models 1 & 2

ivregress 2sls d_trans_taaimp_pc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
ivregress 2sls d_cz_TAAdlrs_petit_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)

gmm (eq1: d_trans_taaimp_pc - {b1}*d_tradeusch_pw - {b2}*l_shind_manuf_cbp - {b3}*l_sh_popedu_c - {b4}*l_sh_popfborn - {b5}*l_sh_empl_f - {b6}*l_sh_routine33 - {b7}*l_task_outsource - {b8}*reg_midatl -{b9}*reg_encen - {b10}*reg_wncen -{b11}*reg_satl - {b12}*reg_escen - {b13}* reg_wscen - {b14}*reg_mount - {b15}*reg_pacif - {b16}*t2 - {b0}) ///
	(eq2: d_cz_TAAdlrs_petit_czpc - {c1}*d_tradeusch_pw - {c2}*l_shind_manuf_cbp - {c3}*l_sh_popedu_c - {c4}*l_sh_popfborn - {c5}*l_sh_empl_f - {c6}*l_sh_routine33 - {c7}*l_task_outsource - {c8}*reg_midatl -{c9}*reg_encen - {c10}*reg_wncen -{c11}*reg_satl - {c12}*reg_escen - {c13}* reg_wscen - {c14}*reg_mount - {c15}*reg_pacif - {c16}*t2 - {c0}) [aw=timepwt48], ///
	 instruments(d_tradeotch_pw_lag l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2) ///
     onestep winitial(unadjusted, indep)

test [b1]_cons = [c1]_cons

* Panel A models 1 & 3

ivregress 2sls d_trans_taaimp_pc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
ivregress 2sls d_cz_TAAdlrs_petit_cert_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)

gmm (eq1: d_trans_taaimp_pc - {b1}*d_tradeusch_pw - {b2}*l_shind_manuf_cbp - {b3}*l_sh_popedu_c - {b4}*l_sh_popfborn - {b5}*l_sh_empl_f - {b6}*l_sh_routine33 - {b7}*l_task_outsource - {b8}*reg_midatl -{b9}*reg_encen - {b10}*reg_wncen -{b11}*reg_satl - {b12}*reg_escen - {b13}* reg_wscen - {b14}*reg_mount - {b15}*reg_pacif - {b16}*t2 - {b0}) ///
	(eq2: d_cz_TAAdlrs_petit_cert_czpc - {c1}*d_tradeusch_pw - {c2}*l_shind_manuf_cbp - {c3}*l_sh_popedu_c - {c4}*l_sh_popfborn - {c5}*l_sh_empl_f - {c6}*l_sh_routine33 - {c7}*l_task_outsource - {c8}*reg_midatl -{c9}*reg_encen - {c10}*reg_wncen -{c11}*reg_satl - {c12}*reg_escen - {c13}* reg_wscen - {c14}*reg_mount - {c15}*reg_pacif - {c16}*t2 - {c0}) [aw=timepwt48], ///
	 instruments(d_tradeotch_pw_lag l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2) ///
     onestep winitial(unadjusted, indep)

test [b1]_cons = [c1]_cons

* Panel A models 1 & 4

ivregress 2sls d_trans_taaimp_pc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
ivregress 2sls d_cz_TAAdlrs_wrks_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)

gmm (eq1: d_trans_taaimp_pc - {b1}*d_tradeusch_pw - {b2}*l_shind_manuf_cbp - {b3}*l_sh_popedu_c - {b4}*l_sh_popfborn - {b5}*l_sh_empl_f - {b6}*l_sh_routine33 - {b7}*l_task_outsource - {b8}*reg_midatl -{b9}*reg_encen - {b10}*reg_wncen -{b11}*reg_satl - {b12}*reg_escen - {b13}* reg_wscen - {b14}*reg_mount - {b15}*reg_pacif - {b16}*t2 - {b0}) ///
	(eq2: d_cz_TAAdlrs_wrks_czpc - {c1}*d_tradeusch_pw - {c2}*l_shind_manuf_cbp - {c3}*l_sh_popedu_c - {c4}*l_sh_popfborn - {c5}*l_sh_empl_f - {c6}*l_sh_routine33 - {c7}*l_task_outsource - {c8}*reg_midatl -{c9}*reg_encen - {c10}*reg_wncen -{c11}*reg_satl - {c12}*reg_escen - {c13}* reg_wscen - {c14}*reg_mount - {c15}*reg_pacif - {c16}*t2 - {c0}) [aw=timepwt48], ///
	 instruments(d_tradeotch_pw_lag l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2) ///
     onestep winitial(unadjusted, indep)

test [b1]_cons = [c1]_cons

* Panel A: models 1 & 5

ivregress 2sls d_trans_taaimp_pc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
ivregress 2sls d_cz_TAAdlrs_wrks_cert_czpc (d_tradeusch_pw=d_tradeotch_pw_lag) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)

gmm (eq1: d_trans_taaimp_pc - {b1}*d_tradeusch_pw - {b2}*l_shind_manuf_cbp - {b3}*l_sh_popedu_c - {b4}*l_sh_popfborn - {b5}*l_sh_empl_f - {b6}*l_sh_routine33 - {b7}*l_task_outsource - {b8}*reg_midatl -{b9}*reg_encen - {b10}*reg_wncen -{b11}*reg_satl - {b12}*reg_escen - {b13}* reg_wscen - {b14}*reg_mount - {b15}*reg_pacif - {b16}*t2 - {b0}) ///
	(eq2: d_cz_TAAdlrs_wrks_cert_czpc - {c1}*d_tradeusch_pw - {c2}*l_shind_manuf_cbp - {c3}*l_sh_popedu_c - {c4}*l_sh_popfborn - {c5}*l_sh_empl_f - {c6}*l_sh_routine33 - {c7}*l_task_outsource - {c8}*reg_midatl -{c9}*reg_encen - {c10}*reg_wncen -{c11}*reg_satl - {c12}*reg_escen - {c13}* reg_wscen - {c14}*reg_mount - {c15}*reg_pacif - {c16}*t2 - {c0}) [aw=timepwt48], ///
	 instruments(d_tradeotch_pw_lag l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2) ///
     onestep winitial(unadjusted, indep)

test [b1]_cons = [c1]_cons

* Panel B: models 1 & 2

ivregress 2sls l_trans_taaimp_pc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
ivregress 2sls l_cz_TAAdlrs_petit_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)

gmm (eq1: l_trans_taaimp_pc - {b1}*l_tradeusch_pw - {b2}*l_shind_manuf_cbp - {b3}*l_sh_popedu_c - {b4}*l_sh_popfborn - {b5}*l_sh_empl_f - {b6}*l_sh_routine33 - {b7}*l_task_outsource - {b8}*reg_midatl -{b9}*reg_encen - {b10}*reg_wncen -{b11}*reg_satl - {b12}*reg_escen - {b13}* reg_wscen - {b14}*reg_mount - {b15}*reg_pacif - {b16}*t2 - {b0}) ///
	(eq2: l_cz_TAAdlrs_petit_czpc - {c1}*l_tradeusch_pw - {c2}*l_shind_manuf_cbp - {c3}*l_sh_popedu_c - {c4}*l_sh_popfborn - {c5}*l_sh_empl_f - {c6}*l_sh_routine33 - {c7}*l_task_outsource - {c8}*reg_midatl -{c9}*reg_encen - {c10}*reg_wncen -{c11}*reg_satl - {c12}*reg_escen - {c13}* reg_wscen - {c14}*reg_mount - {c15}*reg_pacif - {c16}*t2 - {c0}) [aw=timepwt48], ///
	 instruments(l_tradeotch_pw l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2) ///
     onestep winitial(unadjusted, indep)

test [b1]_cons = [c1]_cons

* Panel B: models 1 & 3

ivregress 2sls l_trans_taaimp_pc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
ivregress 2sls l_cz_TAAdlrs_petit_cert_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)

gmm (eq1: l_trans_taaimp_pc - {b1}*l_tradeusch_pw - {b2}*l_shind_manuf_cbp - {b3}*l_sh_popedu_c - {b4}*l_sh_popfborn - {b5}*l_sh_empl_f - {b6}*l_sh_routine33 - {b7}*l_task_outsource - {b8}*reg_midatl -{b9}*reg_encen - {b10}*reg_wncen -{b11}*reg_satl - {b12}*reg_escen - {b13}* reg_wscen - {b14}*reg_mount - {b15}*reg_pacif - {b16}*t2 - {b0}) ///
	(eq2: l_cz_TAAdlrs_petit_cert_czpc - {c1}*l_tradeusch_pw - {c2}*l_shind_manuf_cbp - {c3}*l_sh_popedu_c - {c4}*l_sh_popfborn - {c5}*l_sh_empl_f - {c6}*l_sh_routine33 - {c7}*l_task_outsource - {c8}*reg_midatl -{c9}*reg_encen - {c10}*reg_wncen -{c11}*reg_satl - {c12}*reg_escen - {c13}* reg_wscen - {c14}*reg_mount - {c15}*reg_pacif - {c16}*t2 - {c0}) [aw=timepwt48], ///
	 instruments(l_tradeotch_pw l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2) ///
     onestep winitial(unadjusted, indep)

test [b1]_cons = [c1]_cons

* Panel B: models 1 & 4

ivregress 2sls l_trans_taaimp_pc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
ivregress 2sls l_cz_TAAdlrs_wrks_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)

gmm (eq1: l_trans_taaimp_pc - {b1}*l_tradeusch_pw - {b2}*l_shind_manuf_cbp - {b3}*l_sh_popedu_c - {b4}*l_sh_popfborn - {b5}*l_sh_empl_f - {b6}*l_sh_routine33 - {b7}*l_task_outsource - {b8}*reg_midatl -{b9}*reg_encen - {b10}*reg_wncen -{b11}*reg_satl - {b12}*reg_escen - {b13}* reg_wscen - {b14}*reg_mount - {b15}*reg_pacif - {b16}*t2 - {b0}) ///
	(eq2: l_cz_TAAdlrs_wrks_czpc - {c1}*l_tradeusch_pw - {c2}*l_shind_manuf_cbp - {c3}*l_sh_popedu_c - {c4}*l_sh_popfborn - {c5}*l_sh_empl_f - {c6}*l_sh_routine33 - {c7}*l_task_outsource - {c8}*reg_midatl -{c9}*reg_encen - {c10}*reg_wncen -{c11}*reg_satl - {c12}*reg_escen - {c13}* reg_wscen - {c14}*reg_mount - {c15}*reg_pacif - {c16}*t2 - {c0}) [aw=timepwt48], ///
	 instruments(l_tradeotch_pw l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2) ///
     onestep winitial(unadjusted, indep)

test [b1]_cons = [c1]_cons

* Panel B: models 1 & 5

ivregress 2sls l_trans_taaimp_pc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)
ivregress 2sls l_cz_TAAdlrs_wrks_cert_czpc (l_tradeusch_pw=l_tradeotch_pw) l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2 [aw=timepwt48], cluster(statefip)

gmm (eq1: l_trans_taaimp_pc - {b1}*l_tradeusch_pw - {b2}*l_shind_manuf_cbp - {b3}*l_sh_popedu_c - {b4}*l_sh_popfborn - {b5}*l_sh_empl_f - {b6}*l_sh_routine33 - {b7}*l_task_outsource - {b8}*reg_midatl -{b9}*reg_encen - {b10}*reg_wncen -{b11}*reg_satl - {b12}*reg_escen - {b13}* reg_wscen - {b14}*reg_mount - {b15}*reg_pacif - {b16}*t2 - {b0}) ///
	(eq2: l_cz_TAAdlrs_wrks_cert_czpc - {c1}*l_tradeusch_pw - {c2}*l_shind_manuf_cbp - {c3}*l_sh_popedu_c - {c4}*l_sh_popfborn - {c5}*l_sh_empl_f - {c6}*l_sh_routine33 - {c7}*l_task_outsource - {c8}*reg_midatl -{c9}*reg_encen - {c10}*reg_wncen -{c11}*reg_satl - {c12}*reg_escen - {c13}* reg_wscen - {c14}*reg_mount - {c15}*reg_pacif - {c16}*t2 - {c0}) [aw=timepwt48], ///
	 instruments(l_tradeotch_pw l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg* t2) ///
     onestep winitial(unadjusted, indep)

test [b1]_cons = [c1]_cons

***************************************************
*** Manufacturing and TAA vs UI based estimates *** 
***************************************************

*** Table A7 

use "kimpelc_czone.dta", clear

gen difference = mean_l_TAAdlrs_wrks_cert_pc - mean_l_trans_taaimp_pc

eststo clear 
regress difference l_sh_empl_mfg 
esttab using "TableA7.tex", label  keep(l_sh_empl_mfg) se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "")

**********************************
*** Certification success rate *** 
**********************************

*** Table A8 

use "kimpelc_success_rate_yr.dta", clear

egen state_id = group(state_full)

eststo clear 
eststo: xi: regress success_rate dem_governor, cluster(state_id) 
eststo: xi: regress success_rate dem_governor i.state_id, cluster(state_id) 
eststo: xi: regress success_rate dem_governor i.state_id i.year, cluster(state_id)
eststo: xi: regress success_rate_wrks dem_governor, cluster(state_id) 
eststo: xi: regress success_rate_wrks dem_governor i.state_id, cluster(state_id) 
eststo: xi: regress success_rate_wrks dem_governor i.state_id i.year, cluster(state_id)

esttab using "TableA8.tex", label keep(dem_governor) se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars indicate("State FE = *state*" "Year FE = *year*")


************************************
*** Change in TAA Responsiveness *** 
************************************

*** Table A13

use "kimpelc_czone_yr.dta", clear

eststo clear
eststo: regress petitioningwrks_pw l_tradeusch_pw t2 [aw=timepwt48] if year < 2008, cluster(statefip)
eststo: regress petitioningwrks_pw l_tradeusch_pw t2 l_tradeusch_pw_t2  l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg*  [aw=timepwt48] if year < 2008, cluster(statefip)

eststo: regress estcertifiedwrks_pw l_tradeusch_pw t2 [aw=timepwt48] if year < 2008, cluster(statefip)
eststo: regress estcertifiedwrks_pw l_tradeusch_pw t2 l_tradeusch_pw_t2  l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg*  [aw=timepwt48] if year < 2008, cluster(statefip)

eststo: regress petitioningwrks_pw l_tradeusch_pw t2 [aw=timepwt48] if year < 2011, cluster(statefip)
eststo: regress petitioningwrks_pw l_tradeusch_pw t2 l_tradeusch_pw_t2  l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg*  [aw=timepwt48] if year < 2011, cluster(statefip)

eststo: regress estcertifiedwrks_pw l_tradeusch_pw t2 [aw=timepwt48] if year < 2011, cluster(statefip)
eststo: regress estcertifiedwrks_pw l_tradeusch_pw t2 l_tradeusch_pw_t2  l_shind_manuf_cbp l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource reg*  [aw=timepwt48] if year < 2011, cluster(statefip)

esttab using "TableA13.tex", label  keep(l_tradeusch_pw t2 l_tradeusch_pw_t2) se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars

*************************************************************
*** TAA Responsiveness and the 2016 Republican Vote Share *** 
*************************************************************

*** Table A14

use "kimpelc_election.dta", clear

eststo clear 
eststo: regress rep_share_0016 response, cluster(statefip)
eststo: regress rep_share_0016 response l_shind_manuf_cbp l_sh_routine33 l_task_outsource, cluster(statefip)
eststo: regress rep_share_0016 response l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born, cluster(statefip)
eststo: regress rep_share_0016 response l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born reg*, cluster(statefip)

esttab using "TableA14.tex", label  keep(response l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born) indicate("Region FE =  reg_pacif") se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars

*** Table A16

eststo clear 
eststo: regress rep_share_0016 response_cert, cluster(statefip)
eststo: regress rep_share_0016 response_cert l_shind_manuf_cbp l_sh_routine33 l_task_outsource, cluster(statefip)
eststo: regress rep_share_0016 response_cert l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born, cluster(statefip)
eststo: regress rep_share_0016 response_cert l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born reg*, cluster(statefip)
esttab using "TableA16.tex", label  keep(response_cert) indicate("2000 Industry/Occupation Controls = l_task_outsource" "Individual Demographics = college_educated" "Region FE =  reg_pacif") se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars

*** Table A17

eststo clear 
eststo: regress rep_share_0016 response, cluster(statefip)
eststo: regress rep_share_0016 response l_shind_manuf_cbp l_sh_routine33 l_task_outsource dem_governor union_density, cluster(statefip)
eststo: regress rep_share_0016 response l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born dem_governor union_density, cluster(statefip)
eststo: regress rep_share_0016 response l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born dem_governor union_density reg*, cluster(statefip)
eststo: regress rep_share_0016 response l_shind_manuf_cbp l_sh_routine33 l_task_outsource dem_governor union_density success_rate1990, cluster(statefip)
eststo: regress rep_share_0016 response l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born dem_governor union_density success_rate1990, cluster(statefip)
eststo: regress rep_share_0016 response l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born dem_governor union_density reg* success_rate1990, cluster(statefip)
esttab using "TableA17.tex", label  keep(response dem_governor union_density success_rate1990) indicate("2000 Industry/Occupation Controls = l_task_outsource" "Individual Demographics = college_educated" "Region FE =  reg_pacif") se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars

*** Table A18

eststo clear 
eststo: regress rep_share_0016 response_va, cluster(statefip)
eststo: regress rep_share_0016 response_va l_shind_manuf_cbp l_sh_routine33 l_task_outsource dem_governor union_density, cluster(statefip)
eststo: regress rep_share_0016 response_va l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born dem_governor union_density, cluster(statefip)
eststo: regress rep_share_0016 response_va l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born dem_governor union_density reg*, cluster(statefip)
eststo: regress rep_share_0016 response_va l_shind_manuf_cbp l_sh_routine33 l_task_outsource dem_governor union_density success_rate1990, cluster(statefip)
eststo: regress rep_share_0016 response_va l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born dem_governor union_density success_rate1990, cluster(statefip)
eststo: regress rep_share_0016 response_va l_shind_manuf_cbp l_sh_routine33 l_task_outsource *_share college_educated foreign_born dem_governor union_density reg* success_rate1990, cluster(statefip)

esttab using "TableA18.tex", label  keep(response_va dem_governor union_density success_rate1990) indicate("2000 Industry/Occupation Controls = l_task_outsource" "Individual Demographics = college_educated" "Region FE =  reg_pacif") se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars

* czone level

gen college_educated_pop = pop_total*college_educated/100
gen foreign_born_pop = pop_total*foreign_born/100

foreach var of varlist albertgorejr_2000 georgewbush_2000 hillaryclinton_2016 donaldjtrump_2016 college_educated_pop foreign_born_pop pop_female pop_hispanic pop_20_24 pop_25_34 pop_35_44 pop_45_54 pop_55_59 pop_60_64 pop_65_74 pop_75_84 pop_85 pop_white pop_black pop_native pop_asian pop_total{
	bysort czone: egen `var'_cz = total(`var')
}

gen repshare00_cz = georgewbush_2000_cz/(albertgorejr_2000_cz + georgewbush_2000_cz)
gen repshare16_cz = donaldjtrump_2016_cz/(hillaryclinton_2016_cz + donaldjtrump_2016_cz)
gen repshare0016_cz = (repshare16_cz - repshare00_cz)*100

foreach var of varlist college_educated_pop_cz foreign_born_pop_cz pop_female_cz pop_hispanic_cz pop_20_24_cz pop_25_34_cz pop_35_44_cz pop_45_54_cz pop_55_59_cz pop_60_64_cz pop_65_74_cz pop_75_84_cz pop_85_cz pop_white_cz pop_black_cz pop_native_cz pop_asian_cz {
	gen `var'_2 = (`var'/pop_total_cz)*100
	drop `var'
	rename `var'_2 `var'
}

duplicates drop czone, force

*** Table A15

eststo clear 
eststo: regress repshare0016_cz response, cluster(statefip)
eststo: regress repshare0016_cz response l_shind_manuf_cbp l_sh_routine33 l_task_outsource, cluster(statefip)
eststo: regress repshare0016_cz response l_shind_manuf_cbp l_sh_routine33 l_task_outsource college_educated_pop_cz foreign_born_pop_cz pop_female_cz pop_hispanic_cz pop_20_24_cz pop_25_34_cz pop_35_44_cz pop_45_54_cz pop_55_59_cz pop_60_64_cz pop_65_74_cz pop_75_84_cz pop_85_cz pop_white_cz pop_black_cz pop_native_cz pop_asian_cz, cluster(statefip)
eststo: regress repshare0016_cz response l_shind_manuf_cbp l_sh_routine33 l_task_outsource college_educated_pop_cz foreign_born_pop_cz pop_female_cz pop_hispanic_cz pop_20_24_cz pop_25_34_cz pop_35_44_cz pop_45_54_cz pop_55_59_cz pop_60_64_cz pop_65_74_cz pop_75_84_cz pop_85_cz pop_white_cz pop_black_cz pop_native_cz pop_asian_cz reg*, cluster(statefip)

esttab using "TableA15.tex", label  keep(response) indicate("2000 Industry/Occupation Controls = l_task_outsource" "Individual Demographics = college_educated_pop_cz" "Region FE =  reg_pacif") se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars

************************
*** TAA Yearly Trend *** 
************************

*** Figure A1

use "kimpelc_yr.dta", clear

graph bar (asis) petitions_n, over(year, label(labcolor(black) labsize(medium) labgap(1) angle(45)))  bar(1) ytitle(frequency, size(medlarge)) /// 
	graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) ///
	xsize(6.5) ysize(4)


